package org.korifey.ffbdd.samples.assign;

import java.util.HashSet;
import java.util.Set;

import org.korifey.ffbdd.api.IBdd;
import org.korifey.ffbdd.api.deprecated.Bdd;
import org.korifey.ffbdd.impl.BddDomainImpl;
import org.korifey.ffbdd.impl.ROBDD;

public class AssignROBDD {
	Timetable timetable;
	
	class ContextStorage {
		IBdd<Integer>[] consumer;
		//int startVar;
		int varnum;
		
		public ContextStorage(Timetable t) {
			//startVar = Bdd.getNextVar();
			consumer = new IBdd[t.getSize()];
			for (int i=0; i<consumer.length; i++) {
				//consumer[i] = BddDomain.mkConst(null);
				//consumer[i] = consumer[i].insertNewList(t.getConsumerResources(i));
			}
			//varnum = Bdd.getNextVar() - startVar;
		}

		public void addIteration(int index) {
			for (int i=0; i<index; i++) {
				//consumer[index] = Bdd.cond(Bdd.notEq(consumer[i], consumer[index]), consumer[index], -1)
				//consumer[index] = consumer[index].condNE(consumer[i], -1);
			}
		}

		public Set<Integer[]> getResult() {
			if (consumer[consumer.length - 1].isConst()) return new HashSet();
			else return null;
		}
		
	}
	
	Set<int[]> solves;
	
	public Set<int[]> solve(Timetable t) {
		timetable = t;
		
		ContextStorage s = new ContextStorage(timetable);
		for (int i=0; i<t.getSize(); i++) {
			s.addIteration(i);
		}
		
		//solves = s.getResult();
		
		return solves;
	}
}
